package com.applink.sell_proof.fragment.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;

import com.applink.sell_proof.fragment.AllClaimFragment;
import com.applink.sell_proof.fragment.DraftClaimFragment;
import com.applink.sell_proof.fragment.SubmittedClaimFragment;
import com.applink.sell_proof.fragment.VerifyClaimFragment;

/**
 * @author Hoang Viet
 * 
 */
public class ClaimFragmentPagerAdapter extends BaseFragmentPagerAdapter {
	private static final String[] TITLES = new String[] { "ALL", "VERIFIED",
			"SUBMITTED", "DRAFT" };
	
	public static final int INDEX_ALL = 0;
	public static final int INDEX_VERIFIED = 1;
	public static final int INDEX_SUBMITTED = 2;
	public static final int INDEX_DRAFT = 3;

	public ClaimFragmentPagerAdapter(FragmentManager fm) {
		super(fm, TITLES);
	}

	@Override
	public Fragment getItem(int index) {
		switch (index) {
		case INDEX_ALL:
			AllClaimFragment fragment0 = new AllClaimFragment();
			mFragments.put(index, fragment0);
			return fragment0;
		case INDEX_SUBMITTED:
			SubmittedClaimFragment approval = new SubmittedClaimFragment();
			mFragments.put(index, approval);
			return approval;
		case INDEX_VERIFIED:
			VerifyClaimFragment pending = new VerifyClaimFragment();
			mFragments.put(index, pending);
			return pending;
		case INDEX_DRAFT:
			DraftClaimFragment draft = new DraftClaimFragment();
			mFragments.put(index, draft);
			return draft;
		default:
			return null;
		}
	}
}
